package cn.itsource.pethome.quartz.test;

import org.quartz.*;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @description: 描述:
 * @date: 2020/8/27 10:05
 * @author: summer
 * version: 1.0
 */
@Configuration
public class QuartzConfig {

//    @Bean
//    public JobDetail newJob(){
//        JobDetail build = JobBuilder.newJob(PrintTimeJob.class)
//                .withIdentity("myDetail")
//                .usingJobData("msg", "测试")
//                .storeDurably()
//                .build();
//        return build;
//    }

//    @Bean
//    public Trigger trigger(){
//        //
//        CronScheduleBuilder cronScheduleBuilder =
//                CronScheduleBuilder.cronSchedule("0/1 * * * * ?");
//        //触发器
//        CronTrigger myTrigger = TriggerBuilder.newTrigger()
//                .withIdentity("myTrigger") //给Trigger起个名字
//                .forJob(newJob())      //关联上述的JobDetail
//                .withSchedule(cronScheduleBuilder)
//                .build();
//        return myTrigger;
//    }
}
